
	 var baseUrl = 'https://api.bingoyp.com/wx/'
	 // var baseUrl = "http://192.168.0.105:8082";
function reload() {
	window.location.reload(true);
}

function unfullscreen() {
	// 设置应用非全屏显示！
	plus.navigator.setFullscreen(false);
}
$.ajaxSetup({
	beforeSend: function(request, o) {
		var token = window.localStorage.getItem('token');
		request.setRequestHeader("X-Ceoshop-Token", token);
	}
// 	,
// 	timeout: 3000,
// 	//调用执行后调用的函数
// 	complete: function(XMLHttpRequest, textStatus) {
// 		if (textStatus == 'timeout') {
// 			mui.alert("网络超时，请刷新", function() {
// 				location.reload();
// 			})
// 		}
// 	}
});

var http = {
	get: function(url, data, callback) {
		data = data == null || data == "" || typeof data == "undefined" ? 0 : data;
		$.ajax({
			type: 'get',
			data: data,
			url: baseUrl + url,
			dataType: "json",
			success: function(d) {
				callback(d)
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				console.log(XMLHttpRequest)
			}
		});
	},

	post: function(url, data, callback) {
		data = data == null || data == "" || typeof data == "undefined" ? 0 : data;
		$.ajax({
			type: "post",
			data: data,
			url: baseUrl + url,
			dataType: "json",
			success: function(d) {
				callback(d)
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
				console.log(XMLHttpRequest)
			}
		});
	}
}
